The text regions of the Maple worksheet and the various algebraic output regions are automatically written to a file along with appropriate latex macros so that the contents of the worksheet can then be formatted and printed using LATEX. Of particular interest is the fact that the math typeset regions, including the multi-line displays, are reformatted to the user specified column width using Maple's LATEX math formatting capabilities1. This feature automatically carries out linebreaking of large mathematical formulae in LATEX.
The automatically generated LATEX source document (say ``worksheet.tex'') has a structure similar to that shown below.
\documentclass{article} \usepackage{maplems} \begin{document} First paragraph of text. Second paragraph of text. This is a test file. \begin{mapleinput} (a + b); \end{mapleinput} \begin{maplelatex} \[ {a} + {b} \] \end{maplelatex} We can display mathematics in a variety of forms. \begin{mapleinput} Int( 1/(1 + x^4),x); \end{mapleinput} \begin{maplelatex} \[ {\displaystyle \int} {\displaystyle \frac {1}{1 + {x}^{4}}}\,{d}{ x} \] \end{maplelatex} \begin{mapleinput} value("); \end{mapleinput} \begin{maplelatex} \begin{eqnarray*} \lefteqn{{\displaystyle \frac {1}{8}}\,\sqrt {2}\,{\rm ln} \left( {\vrule height0.89em width0em depth0.89em} \right. \, {\displaystyle \frac {{x}^{2} + {x}\,\sqrt {2} + 1}{{x}^{2} - {x} \,\sqrt {2} + 1}}\, \left. {\vrule height0.89em width0em depth0.89em} \right) + {\displaystyle \frac {1}{4}}\,\sqrt {2}\,{\rm arctan} \left( {\vrule height0.41em width0em depth0.41em} \right. \,{x}\,\sqrt { 2} + 1\, \left. {\vrule height0.41em width0em depth0.41em} \right) } \\ & & \mbox{} + {\displaystyle \frac {1}{4}}\,\sqrt {2}\,{\rm arctan} \left( {\vrule height0.41em width0em depth0.41em} \right. \,{x}\,\sqrt {2} - 1\, \left. {\vrule height0.41em width0em depth0.41em} \right) \mbox{\hspace{88pt}} \end{eqnarray*} \end{maplelatex} And more... TTY based output is handled as \begin{mapleinput} Int((x+a)^3,x=a..b); \end{mapleinput} \begin{maplettyout} b / | 3 | (x + a) dx | / a \begin{maplettyout} We can even include a plot. \mapleplot{worksht.ps1} \maplesepline \end{document} %% End of Maple V Session Output
Maple's text regions from the original worksheet become ordinary LATEX paragraphs. Except for embedded graphics, the other regions (Maple input, Maple typeset mathematics output, and Maple character based mathematics output) are formatted using an appropriate LATEX environment.
If you wish the text regions to be processed as is, with no special
meaning assigned to LATEX characters such as _
or ^
,
use the package option worksheet as in
The maplems style sets up page sizes, headers and footers, and then uses the style package mapleenv to tell LATEXhow to format each of these special environments. Thus, the document can be printed as is. The document can also be enhanced by editing in standard LATEX constructs. Experienced LATEX users can redefine these style macros to achieve specific effects and Most mathematics publishers have their own style macros that can be modified to work in conjunction with these macros.